#@adminLayout()
#define main()
#set(pageId=RandomUtil.random(6))
<div class="jbolt_page" data-key="#(pmkey)" id="master_slave_#(pageId)">
<div class="jbolt_page_title">
	<div class="row">
	<div class="col-4">
	<h1>主从表管理demo-JBoltTable</h1>
	</div>
	<div class="col-6">
		<form class="form-inline" id="masterSlaveForm_#(pageId)" action="demo/masterslave"  method="get"></form>
	</div>
	<div class="col-2">
	<button data-area="600,400" id="jboltTableMasterAddBtn_#(pageId)" data-handler="refreshJBoltTable" data-title="新增版本" data-url="admin/jboltversion/add" class="pull-right jbolt_table_addbtn btn btn-success" ><i class="fa fa-plus"></i> 新增</button>
	</div>
	</div>
</div>
<div class="jbolt_page_content" style="height: calc(100vh - 140px)">
<div class="jbolttable_master_slave_box">
<div class="split master" id="master_#(pageId)">
    	 <!-- JBoltTable的数据模板定义-->
<script type="text/template" id="jboltTable_master_demotpl">
{@each datas as data,index}
<tr onclick="masterTableTrTriggerShowSlave(this,'${data.id}')">
{@if pageSize&&pageSize>0}
<td>${((pageNumber-1)*pageSize)+(+index+1)}</td>
{@else}
<td>${+index+1}</td>
{@/if}
<td>${data.version}</td>
<td>${data.publishTime|date_ymdhm}</td>
<td>${data.createTime|date_ymdhm}</td>
<td><a  tooltip  title="更新文件管理"  href="demo/jbolttable/files/${data.id}" data-scroll="yes"  data-btn="no" data-title="更新文件管理" data-area="980,600" class="jbolt_table_editbtn"><i class="fa fa-files-o c-primary"></i></a></td>
<td><img data-switchbtn data-value="${data.isNew}" data-handler="refreshJBoltTable"  data-url="/demo/jbolttable/toggleIsNew/${data.id}"/></td>
<td>
<a tooltip  title="编辑"  href="demo/jbolttable/edit/${data.id}" data-scroll="yes" data-handler="refreshJBoltTable" data-title="编辑" data-area="600,400" class="jbolt_table_editbtn"><i class="fa fa-pencil c-primary"></i></a>
<a tooltip  title="删除"  href="demo/jbolttable/delete/${data.id}" data-handler="refreshJBoltTable" class="jbolt_table_delbtn"><i class="fa fa-remove c-danger"></i></a>
</td>
</tr>
{@/each}
</script>
 <table class="jbolt_table table_striped thead_font_normal"
  data-fixed-columns-left="1,2"
  data-fixed-columns-right="7"
  data-column-resize="true"
  data-height="fill_box"
  data-ajax="true"
  data-bind-elements="#jboltTableMasterAddBtn_#(pageId)"
  data-conditions-form="masterSlaveForm_#(pageId)"
  data-page="jboltTablePage_master_#(pageId)"
  data-pagesize="10"
  data-url="/demo/masterslave/masterDatas"
  data-rowtpl="jboltTable_master_demotpl"
 >
<thead>
<tr><th data-width="60" data-column="index">序号</th><th data-width="150" data-nochange>版本号</th><th>发布时间</th><th>创建时间</th><th data-width="120" >更新文件管理</th><th data-width="110" data-nochange>是否最新版</th><th data-width="80" data-column="optcol">操作</th></tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="split slave" id="slave_#(pageId)">
<div class="jbolt_tab_view">
  <div class="jbolt_tab_links">
    <a class="jbolt_tab_link active"  href="#jbolt_tabcontent1_#(pageId)">可更新主文件</a>
    <a class="jbolt_tab_link"  href="#jbolt_tabcontent2_#(pageId)">changelog</a>
  </div>
<div class="jbolt_tab_contents">
  <div class="jbolt_tab_content active" id="jbolt_tabcontent1_#(pageId)">
  <form onsubmit="return false;" class="form-inline d-none" id="jboltversion_JboltTableForm1_ajax_#(pageId)" action="demo/jbolttable/ajaxNoPage"  method="post"></form>
<!-- JBoltTable -->
<!-- JBoltTable的数据模板定义-->
<script type="text/template" id="jboltTable_demotpl1_ajax_#(pageId)">
{@each datas as data,index}
<tr>
{@if pageSize&&pageSize>0}
<td>${((pageNumber-1)*pageSize)+(+index+1)}</td>
{@else}
<td>${+index+1}</td>
{@/if}
<td>${data.url}</td>
<td>
<a tooltip  title="编辑"  href="admin/jboltversion/editFile/${data.id}" data-scroll="yes" data-handler="refreshJBoltTable" data-title="编辑" data-area="600,400" class="jbolt_table_editbtn"><i class="fa fa-pencil c-primary"></i></a>
<a tooltip  title="删除"  href="admin/jboltversion/deleteFile/${data.id}" data-handler="refreshJBoltTable" class="jbolt_table_delbtn"><i class="fa fa-remove c-danger"></i></a>
</td>
</tr>
{@/each}
</script>
<div class="jbolt_table_toolbar" id="jbolt_table_toolbar_#(pageId)">
<div class="btn-group" role="group" aria-label="btn-group">
<button data-area="600,400" id="jboltTableAddBtn1_ajax_#(pageId)"  data-handler="jboltTablePageToFirst" data-title="新增版本"  data-srcurl="admin/jboltversion/addFile/[masterId]" data-url="admin/jboltversion/addFile/0" class="jbolt_table_addbtn btn btn-success btn-sm" ><i class="fa fa-plus"></i> 新增</button>
</div>
</div>
	 <table class="jbolt_table table_striped thead_font_normal"
	  data-fixed-columns-left="1,2"
	  data-fixed-columns-right="7"
	  data-height="fill_box"
	  data-ajax="true"
	  data-toolbar="jbolt_table_toolbar_#(pageId)"
	  data-bind-elements="#jboltTableAddBtn1_ajax_#(pageId)"
	  data-conditions-form="jboltversion_JboltTableForm1_ajax_#(pageId)"
	  data-orign-url="demo/masterslave/mainFilesDatas/[masterId]"
	  data-url="demo/masterslave/mainFilesDatas/0"
	  data-rowtpl="jboltTable_demotpl1_ajax_#(pageId)"
	  data-page="jboltTablePage_ajax1_#(pageId)"
	  data-pagesize="10"
	 >
<thead>
<tr><th data-width="60" data-column="index">序号</th><th>URL</th><th data-width="80" data-nochange>操作</th></tr>
</thead>
<tbody></tbody>
</table>
  </div>
  <div class="jbolt_tab_content" id="jbolt_tabcontent2_#(pageId)">
	<div data-ajaxportal data-orign-url="/demo/masterslave/changelogPortal/[masterId]" data-url="/demo/masterslave/changelogPortal/0"></div>
  </div>
</div>
</div> 

</div>
</div>
</div>
</div>
#end
#define js()
<script>
function initHandlerMs_#(pageId)(){
	var jboltTables,tempTable;
	loadJBoltPlugin(['splitjs'], function(){
		Split(['#master_#(pageId)', '#slave_#(pageId)'],{
			direction:'vertical',
			sizes:[40,60],
			gutterSize:6,
			onDragEnd:function(){
				jboltTables.each(function(){
					tempTable=$(this).jboltTable("inst");
					tempTable.me.processTableFillBox(tempTable);
					});
				}
		});
		loadJBoltPlugin(['jbolttable'], function(){
			jboltTables=$("#master_slave_#(pageId)").find(".jbolt_table").attr("data-jbolttable",true).jboltTable();
		});
	});
	
}
$(function(){
	mainPjaxContainer.css({
		"overflow":"hidden"
	});
	initHandlerMs_#(pageId)();
});
</script>
#end

